# Maintainer: omni <omni+alpine@hack.org>
pkgname=viu
pkgver=1.4.0
pkgrel=0
pkgdesc="terminal image viewer"
arch="all !s390x !riscv64" # limited by cargo
url="https://github.com/atanunq/viu"
license="MIT"
makedepends="cargo"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/atanunq/viu/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	cargo fetch --locked
}

build() {
	cargo build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm0755 target/release/"$pkgname" -t "$pkgdir"/usr/bin
	install -Dm0644 README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
	install -Dm0644 LICENSE-MIT -t "$pkgdir"/usr/share/licenses/"$pkgname"
}

sha512sums="
6e0cbd678c8c9d0d100fca3d9fdac2223b088afca23982e98f9c51e93fd6490892fa46dcdfa7554277e52a5eeb40ca07799bce88eddc6e3c2f618b7595f046ec  viu-1.4.0.tar.gz
"
